LotusScript Doc

Class: LSAOrgaUnit

The LSAOrgaUnit is the main class of the LSA Orga Interface. Every entity within the LSA Orga database (groups, persons, traits) are LSAOrgaUnit objects.
All properties or methos which don't have a description here are for internal use only .

Author:
LPS EMEA
Version:
1.1.y, 18.APR.2000
History:
09.May.2000RPrchanged errorhandlers with Errormessages 30.Aug 2000 RPr Bugfix read from LSAOrgDelimiters instead of LSAOrgDelimiter Field in New method 12.SEP.2000 RPr set flag IsSummary to TRUE in WriteCustomerData 09.OCT.2000 RPr Bugfix setting field "LSAOrgAddressInterface" 09.OCT.2000 RPr Bugfix generating trait reference strings 22.JAN.2001 RPr Added DefaultHierarchyPath Property



Property Summary
Public Property Get AddresseS As LSAAddressData
Public Property Get AddrMgr As Variant
Public Property Set AddrMgrID As String
Public Property Get AddrMgrID As String
Public Property Get AliasNotesNameS As LSAOrgaAliasseS
Public Property Get ChangeRequests As LSAOrgaChangeRequest
Public Property Set Children As LSAOrgaCollection
Public Property Get Children As LSAOrgaCollection
Public Property Get DefaultHierarchyPath As String
Public Property Set DefaultSurrogateS As LSAOrgaCollection
Public Property Get DefaultSurrogateS As LSAOrgaCollection
Public Property Set Delimiter As Variant
Public Property Get Delimiter As Variant
Public Property Set Description As String
Public Property Get Description As String
Public Property Set DisplayName As String
Public Property Get DisplayName As String
Public Property Set FormulaForSerialData As Variant
Public Property Set NotesName As String
Public Property Get NotesName As String
Public Property Set NotesType As String
Public Property Get NotesType As String
Public Property Get OrgaType As LSAOrgaType
Public Property Set ParentS As LSAOrgaCollection
Public Property Get ParentS As LSAORgaCollection
Public Property Get PersonData As LSAOrgaPersonRecord
Public Property Get SerialInterfaceData As Variant
Public Property Get SyncInfo As LSASync
Public Property Get Traits As LSAOrgaCollection
Public Property Set UnavailabilityTimeS As Variant
Public Property Get UnavailabilityTimeS As Variant
Public Property Get UnitInstanceID As String
Public Property Set UserAccessAuthorS As Variant
Public Property Get UserAccessAuthorS As Variant

Method Summary
Function ConvertFormula (Instring As String) As String
Function CreateUnitDoc () As NotesDocument
Sub Delete ()
Function FormulaEvaluate (formula As String, doc As notesdocument) As Variant
Function GetChildsSurrogation (Child As LSAOrgaUnit) As LSAOrgaCollection
Function getCustomerContactSearchCriterias () As Variant
Function getCustomerOrganizationSearchCriterias () As Variant
Function getCustomerSerialData () As String
Function getDisplayName () As String
Function getOrganizationData () As String
Function getOrganizationS () As Variant
Function getPersonData () As String
Function getReference () As String
Function HasChild (Child As Variant, as As Variant, LSAOrgaUnit As Variant) As Variant
Function HasParent (Parent As Variant, as As Variant, LSAOrgaUnit As Variant) As Variant
Sub New (AttribCorrespondingDocument As NotesDocument, AttribDisplayName As String, AttribNotesName As String, AttribNotesType As String, AttribOrgaType As LSAOrgaType, orgaDB As NotesDatabase, OrgaLog As LSAOrgaLog, SurrogationDate As NotesDateTime, parViewAllUnits As NotesView, paraddrview As NotesView, addrMgrID As String)
Function ReadCustomerData (field As String) As Variant
Sub Remove ()
Function Save () As Integer
Sub SaveWithoutUpdate (strPropertyName As String, vNewValue As Variant)
Sub setAllPropertiesAccordingToType ()
Sub SetChildsSurrogation (Child As LSAOrgaUnit, Surrogates As LSAOrgaCollection)
Function SetDefaultHierarchyFromParent (ParentUnit As Variant, as As Variant, LSAOrgaUnit As Variant) As Variant
Sub SetNotesTypeAccordingToType (strNABGroupType As String)
Sub UpdateSerialData ()
Function validAliasNames (AliasNamesToCheck As Variant) As Integer
Sub WriteCustomerData (field As String, value As Variant)

Property Detail

Public Property Set UnavailabilityTimeS AsVariant

This property sets times of unavailibility for units (person and groups, not traits). The value has to be set as list of dates or date ranges. For date ranges the begin and the end has to be separated by using a dash ("-"). The separator has to be set as "/" or "." regardless of the operating system used.

Use Case:
We want to set unavailability times for a person unit:
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Dim allTimes As Variant

Set aOrgaUnit = OrgaManager.GetUnitByName("Testperson") If not aOrgaUnit is Nothing then Redim allTimes(1) As String allTimes(0) = "1.12.2000" allTimes(1) = "13.11.2000 - 24.11.2000" aOrgaUnit.UnavailabilityTimeS = allTimes call aOrgaUnit.save Delete aOrgaUnit End If


Parameters:
UnavailabilityTimeSVariantString or array of strings containing the dates and/or date-ranges.
History:
04.APR.2000ggredesign
Summmary Top

Public Property Get UnavailabilityTimeS AsVariant

This property reads the times of unavailibility for units (person and groups, not traits). If no unavailability times are defined an empty string will be returned.

Use Case:
We want to read the unavailability times for a person unit:
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Dim allTimes As Variant

Set aOrgaUnit = OrgaManager.GetUnitByName("Testperson") If not aOrgaUnit is Nothing then allTimes = aOrgaUnit.UnavailabilityTimeS End If

Returns:
UnavailabilityTimeSVariant Times of unavailability as a list of dates or dateranges
History:
04.APR.2000ggredesign
Summmary Top

Public Property Set UserAccessAuthorS AsVariant

This property sets author access rights for units (for documents of persons, groups and traits). Persons or groups can be authorized to edit documents in LSAOrga. The roles given in LSA-Orga cannot be overwritten by using this property. Using this property means that the old values will be overwritten. So it may be necessary to read the old values before writing the new values.

Use Case:
We want to add the role "[TestRoles]" to the author access field in the "Testperson" unit
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Dim allAuthors As Variant
	
    Set aOrgaUnit = OrgaManager.GetUnitByName("Testperson")
    If Not aOrgaUnit Is Nothing Then
        allAuthors = aOrgaUnit.UserAccessAuthors
        Redim Preserve allAuthors(Ubound(allAuthors)+1) As String
        allAuthors(Ubound(allAuthors)) = "[TestRoles]"
        aOrgaUnit.UserAccessAuthors = allAuthors 
        Call aOrgaUnit.save
        Delete aOrgaUnit
    End If

Parameters:
UserAccessAuthorSVariantPersons and/or groups that should be able to do changes to the unit document
History:
04.APR.2000ggredesign
Summmary Top

Public Property Get UserAccessAuthorS AsVariant

This property reads all person and/or groups which have author access rights for a unit document. In addition to this property access rights for unit documents can be given by using the roles defined in LSA-Orga. In the case of no access right definition for a unit "Empty" will be returned.

Use Case:
We want to read the author access rights in the "Testperson" unit
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Dim allAuthors As Variant
	
    Set aOrgaUnit = OrgaManager.GetUnitByName("Testperson")
    If Not aOrgaUnit Is Nothing Then
        allAuthors = aOrgaUnit.UserAccessAuthors 
    End If

Returns:
UserAccessAuthorSVariant Persons and/or groups that are able to do changes to the unit document
History:
04.APR.2000ggredesign
Summmary Top

Public Property Get OrgaType AsLSAOrgaType

This property reads the Orga type of units as defined in the meta modell. For example the result can be the type "external employee" or "internal employee" for a person.

Use Case:
we want to get the Orga Type object of the Testperson:
Dim OrgaManager As New LSAOrgaManager("","LSAORGA","","LSAORGALOG")
Dim OrgaUnit As LSAOrgaUnit
Dim aOrgaType as LSAOrgaType

Set OrgaUnit = OrgaManager.GetUnitByName("TestPerson") If Not OrgaUnit Is Nothing Then aOrgaType = OrgaUnit.OrgaType End If

Returns:
OrgaTypeLSAOrgaType Type object as defined in the meta modell of LSA-Orga.
See also:
LSAOrgaInterfaceClasses.LSAOrgaType
History:
04.APR.2000ggredesign
Summmary Top

Public Property Set NotesType AsString

This property sets the NotesType of units for persons, groups and traits. If the NotesType to be set is not allowed like defined in the meta modell of the appropriate document no error message will come up. The Notestype will be set like defined in the meta modell.
Values for groups and traits:
"0" = Multi purpose (Default)
"1" = Mail only
"2" = Access control list only
"3" = Deny list only
"5" = None
Values for persons:
"NAB" = from NAB
"Orga" = Non-NAB
"Interface" = choose when created

Non-NAB users will not be synchronized with the domino directory. But if they have a valid NotesName they will be generated into domino directory groups - the latter is only possible if the units are of the NotesType "Interface".
The NotesType of a unit must match the NotesType of its type definition: except for the NotesType "Choose when created" in the type definition the NotesType of the unit must always be the same as in the type definition. You cannot set the NotesType of a Unit to a value that does not match with the type definition - if you do, this change will not be saved, but the value from the type definition will be set into the unit.
If you have a NotesType for groups from 0-3, for persons "NAB", you must also set the NotesName of the unit to a not empty string, otherwise this unit will not be saved. If you change the NotesType from a value with a NotesName to a value without NotesName, the NotesNames in the units will be set to an empty string.

Use Case:
you want to set the NotesType of the Testperson to "Interface" (only possible if also in the OrgaType of this unit specified with "Interface" or "Choose when created"):
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
	
    Set aOrgaUnit = OrgaManager.GetUnitByName("Testperson")
    If Not aOrgaUnit Is Nothing Then
        aOrgaUnit.NotesType = "Interface" 
        Call aOrgaUnit.save
        Delete aOrgaUnit
    End If

Parameters:
NotesTypeStringType of group or trait for domino directory and kind of person in LSA-Orga
See also:
LSAOrgaInterfaceClasses.LSAOrgaType#SetNotesType
History:
04.APR.2000ggredesign
Summmary Top

Public Property Get NotesType AsString

This property reads the Notes type of units for persons, groups and traits.
For groups and traits:
0 = Multi purpose (Default)
1 = Mail only
2 = Access control list only
3 = Deny list only
5 = None
For persons:
"NAB" = from NAB
"Orga" = Non-NAB
"Interface" = choose when created

Use Case:
you want to read the NotesType of the "Testperson" unit :
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Dim aNotesName as String
	
    Set aOrgaUnit = OrgaManager.GetUnitByName("Testperson")
    If Not aOrgaUnit Is Nothing Then
         aNotesName = aOrgaUnit.NotesType 
    End If

Returns:
NotesTypeString Type of group or trait for domino directory and indicator if person has NotesName in LSA-Orga
See also:
LSAOrgaInterfaceClasses.LSAOrgaUnit#SetNotesType
History:
04.APR.2000ggredesign
Summmary Top

Public Property Set NotesName AsString

This property sets the Notesname of a unit (group, person or trait). For groups and traits the NotesName is the name of the group for its appropriate group in the domino dircctory, for person unit its canonical Notes username. The NotesName has to be unique in the LSA-Orga database. Otherwise this unit will not be saved, and an entry will be created in the Log Database:
"LSAOrgaUnit.Save : [Unit.DisplayName] - 16001 - This notes name already exists"
The change of the NotesName must be populated throughout the whole LSAOrga database, that's why it is necessary to finally call the "LSAOrgaManager.PopulateAllChanges" method or run the agent "LSAOrgEng cUpdate" in the LSAOrga database.

Use Case:
we want to set a NotesName for the "Testperson" unit
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Dim success As Integer
      Set aOrgaUnit = OrgaManager.GetUnitByName("TestPerson")
      If Not aOrgaUnit Is Nothing Then
          aOrgaUnit.NotesName = "Testperson" 
          success = aOrgaUnit.save
          Delete aOrgaUnit
      End If
      If success Then  Call OrgaManager.PopulateAllChanges 

Parameters:
NotesNameStringGroup name of domino directory for groups and traits, canonical Notes username for persons.
See also:
LSAOrgaInterfaceClasses.LSAOrgaUnit#SetNotesType
History:
04.APR.2000ggredesign
Summmary Top

Public Property Get NotesName AsString

This property reads the NotesName of a unit (group, person or trait). For groups and traits the NotesName is the name of the group for its appropriate group in the domino directory. For person it's the canonical Notes username. The NotesName is unique in the LSAOrga database.

Use Case:

Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Dim aNotesName as String

Set aOrgaUnit = OrgaManager.GetUnitByName("Testperson") If Not aOrgaUnit Is Nothing Then aNotesName = aOrgaUnit.NotesName Messagebox aNotesName End If

Returns:
NotesNameString Group name of domino directory for groups and traits, canonical Notes username for persons.
See also:
LSAOrgaInterfaceClasses.LSAOrgaUnit.SetNotesName
History:
04.APR.2000ggredesign
Summmary Top

Public Property Set Delimiter AsVariant

This property sets the list of all possible delimiters of the LSAOrga database for the serial data strings. With this property you can only add delimiters to the one which already exist by default in the LSAOrga, these are: "|"; "#"; "~"; "\"; "*" .

Parameters:
DelimiterVariantall additional delimiters
History:
04.APR.2000ggredesign
Summmary Top

Public Property Get Delimiter AsVariant

This property reads the list of all possible delimiters of the LSA-Orga database for the serial strings (e.g. "|" oder "~" etc). It can be more than the default delimiters, if the default delimiter list was enlarged by the setting more delimiters.

Returns:
DelimiterVariant all allowed delimiters
History:
04.APR.2000ggredesign
Summmary Top

Public Property Set DisplayName AsString

This property changes the name (displayname) of a unit. The displayname is the unique name of the unit in the LSAOrga database. Changing the displayname has also affect on other units. This affected changes will be done after running the method PopulateAllChanges. If you specify a displayName which already exists, the unit will not be saved and a message is created in the Log database:
"LSAOrgaUnit.Save : [UnitDisplayName] - 16000 - A unit with this displayname already exists!

Use Case:
We want to change the displayname of the unit "Test" into "Testperson":
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Dim success As Integer
Dim aUnitName As String
	
     Set aOrgaUnit = OrgaManager.GetUnitByName("Test")
     If Not aOrgaUnit Is Nothing Then
        aOrgaUnit.DisplayName = "Testperson" 
        success = aOrgaUnit.save
        Delete aOrgaUnit
     End If
     If success Then	Call OrgaManager.PopulateAllChanges

Parameters:
DisplayNameStringUnique name of a unit in the LSA-Orga database
History:
04.APR.2000ggredesign
Summmary Top

Public Property Get DisplayName AsString

This property reads the unique name of a unit in the LSAOrga database (displayname).

Returns:
DisplaynameString Unique name of a unit in the LSA-Orga database
See also:
LSAOrgaInterfaceClasses.LSAOrgaUnit#SetDisplayName
History:
04.APR.2000ggredesign
Summmary Top

Public Property Set Description AsString

This property sets the description (additional information, remark) of a unit (group, person or trait).

Use Case:
We want to change the description of the unit "Projektgruppe":
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Dim success as Integer
	
     Set aOrgaUnit = OrgaManager.GetUnitByName("Projektgruppe")
     If Not aOrgaUnit Is Nothing Then
        aOrgaUnit.Description = "Unit for Interface Test" 
        success = aOrgaUnit.save
        Delete aOrgaUnit
     End If

Parameters:
DescriptionStringDescription of unit (group, person or trait).
History:
04.APR.2000ggredesign
Summmary Top

Public Property Get Description AsString

This property reads the description of a unit (group, person or trait).

Use Case:
We want to read the description of the unit "Projektgruppe":
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
	
     Set aOrgaUnit = OrgaManager.GetUnitByName("Projektgruppe")
     If Not aOrgaUnit Is Nothing Then
        Messagebox aOrgaUnit.Description 
     End If

Returns:
DescriptionString Description of a unit (group, person or trait).
History:
04.APR.2000ggredesign
Summmary Top

Public Property Get PersonData AsLSAOrgaPersonRecord

This property is for accessing person related data: Firstname; Lastname; Title; MiddleInitial; Suffix; Gender. The values can only be read using this property. For setting data the properties of the class LSAOrgaPersonRecord have to be used.

Use Case:
We want to set the person data into the "Testperson"
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Dim success As Integer
       Set aOrgaUnit = OrgaManager.GetUnitByName("Testperson")
       If Not aOrgaUnit Is Nothing Then
          aOrgaUnit.personData.FirstName =  "Martin"
          aOrgaUnit.personData.LastName =  "Smith"
          aOrgaUnit.personData.MiddleInitial =  "R."
          aOrgaUnit.personData.Title = "Dr."
          aOrgaUnit.personData.Gender =  "M" 
          success = aOrgaUnit.save
          Delete aOrgaUnit
       End If
	   
	   'read the PersonData:
Dim allPersonData As LSAOrgaPersonRecord
	   	
       Set aOrgaUnit = OrgaManager.GetUnitByName("Testperson")
       If Not aOrgaUnit Is Nothing Then
           Set allPersonData = aOrgaUnit.PersonData 
           Messagebox allPersonData.FirstName + " " +  allPersonData.MiddleInitial + " " +  allPersonData.lastName
       End If   

Returns:
LSAOrgaPersonRecordObject of a person record in LSA-Orga
History:
04.APR.2000ggredesign
Summmary Top

Public Property Set FormulaForSerialData AsVariant

One or more formulas for calculation of the user interface data (LotusU). The formulas are the same as in the appropriate fields of the customer subforms. The formulas for the fields have to be set in the following sequence: 1. LSCOrgIntData, 2. LSCOrgIntSearchCriteria, 3. LSCAddrIntData, 4. LSCAddrIntContactSearch, 5. LSCAddrIntOrganizationSearch. The formulas only exist in the objects after setting them. They will not be saved to the document. Only the calculated fields will exist. If a formula is "" (empty string), no evaluation will take place. The fields can be deleted by setting " " (space) for the formula.

Parameters:
FormulaForSerialDataVariantFormulas for setting the LotusU fields of the user interface.
History:
04.APR.2000ggredesign
Summmary Top

Public Property Get SerialInterfaceData AsVariant

This property is only for reading. It delivers the client specific data defined in the user interface in the LotusU format. The values of the fields were calculated by using the formulas of the poperty "FormulaForSerialData". The values come up in the following sequence: 1. LSCOrgIntData, 2. LSCOrgIntSearchCriteria, 3. LSCAddrIntData, 4. LSCAddrIntContactSearch, 5. LSCAddrIntOrganizationSearch).

Returns:
SerialInterfaceDataVariant Values of the user interface fields listed below
History:
04.APR.2000ggredesign
Summmary Top

Public Property Set DefaultSurrogateS AsLSAOrgaCollection

This property sets the default surrogate(s) for a unit (person, group or trait) as it can be done in the user interface of the LSA-Orga. As this property replaces all existing surrogates, you have to read out first the existing surrogates and add your new ones.

Use Case:
We want to add a new Default Surrogate for the "Testperson"
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Dim surrogate As LSAOrgaUnit
Dim allDefaultSurrogates As LSAOrgaCollection
Dim success As Integer
	
        Set aOrgaUnit = OrgaManager.GetUnitByName("TestPerson")
        Set Surrogate = OrgaManager.GetUnitByName("Test")
        If Not aOrgaUnit Is Nothing  And Not surrogate Is Nothing Then
           Set allDefaultSurrogates = aOrgaUnit.DefaultSurrogates
           Call allDefaultSurrogates.addEntry (Surrogate)
           Set aOrgaUnit.DefaultSurrogates = allDefaultSurrogates 
           success = aOrgaUnit.save
           Delete aOrgaUnit
           Delete Surrogate
           Call allDefaultSurrogates.deleteAll
        End If

Parameters:
DefaultSurrogateSLSAOrgaCollectionall surrogates for the unit
History:
04.APR.2000ggredesign
Summmary Top

Public Property Get DefaultSurrogateS AsLSAOrgaCollection

This poperty returns a LSAOrgaCollection with the default surrogate(s) of a unit.

Use Case:
We want to get the names of all default surrogates of the "Testperson":
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Dim surrogate As LSAOrgaUnit
Dim allDefaultSurrogates As LSAOrgaCollection
Dim allNames As String
	
        Set aOrgaUnit = OrgaManager.GetUnitByName("Testperson")
        If Not aOrgaUnit Is Nothing Then
           Set allDefaultSurrogates = aOrgaUnit.DefaultSurrogates 
           Set Surrogate = allDefaultSurrogates.GetFirst()
           allNames = ""
           While Not Surrogate Is Nothing
              If allNames = "" Then
                 allNames = Surrogate.DisplayName
              Else
                 allNames = allNames + "; " + Surrogate.DisplayName
              End If
              Set Surrogate = allDefaultSurrogates.GetNext()
           Wend
           Messagebox allNames
        End If

Returns:
DefaultSurrogateSLSAOrgaCollection all surrogates for the unit
History:
04.APR.2000ggredesign
Summmary Top

Public Property Get SyncInfo AsLSASync

This property is a read only property. With the information in the SyncInfo you can check synchronization data, if you synchronize your unit with external data sources.
The SyncInfo can be set using the method "SyncInfo.SetExtSync". It can be read using the following syntax:
LSAOrgaUnit.SyncInfo.Syncdata

Use Case:
When a new unit is created from the backend we indicate this with the Synchronization Information
Dim OrgaType As LSAOrgaType
Dim OrgaManager As New LSAOrgaManager("","LSAORGA","","LSAORGALOG")
Dim Unit As LSAOrgaUnit
            'Create a new Department unit:
           Set OrgaType  = OrgaManager.GetTypeByName("Department")
           Set Unit = OrgaManager.NewUnit("Sales2", OrgaType, "Sales2", "0")
           Call Unit.SyncInfo.SetExtSync("Interface","SourceSales2",Now) 
           Call Unit.Save()

Returns:
SyncInfoLSASync LSASync object
See also:
LSAOrgaInterfaceClasses.LSASync
History:
04.APR.2000ggredesign
Summmary Top

Public Property Get AddresseS AsLSAAddressData

This poperty returns a LSAAddressData object, which holds all address data of the unit. To work with address data of a organization unit you must use this property of the unit, otherwise inconsistencies of the address data will occur.

Returns:
AddresseSLSAAddressData
See also:
LSALibAddresses.LSAAddressData
History:
04.APR.2000ggredesign
Summmary Top

Public Property Get AliasNotesNameS AsLSAOrgaAliasseS

This poperty returns a LSAOrgaAliasseS object with all alias names of a unit. Note: before LiSA Version 2.0c there is a bug when trying to read the expiration dates.

Use Case:
we want to read the names and expiration dates of the current alias names and set a new one for the group "Sales2":
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Dim allAliasses As LSAOrgaAliasseS
Dim allNames  As Variant
Dim expirationDateItem As Variant
Dim expirationDate As Variant
Dim aKey As String
Dim newAlias As LSAOrgaAliasItem
	
        Set aOrgaUnit = OrgaManager.GetUnitByName("Sales2")
        If Not aOrgaUnit Is Nothing Then
           Set allAliasses = aOrgaUnit.AliasNotesNames 
           allNames = aOrgaUnit.AliasNotesNames.AliasNames
           Forall aName In allNames
               aKey = aName			
               Set expirationDateItem = aOrgaUnit.AliasNotesNames.GetItemByKey(aKey, False)  'don't move the current item
               expirationDate = expirationDateItem.ExpirationDate			
               Messagebox "Alias: " + aName + " expires: " + Cstr(expirationDate) 
           End Forall
           Set newAlias = New LSAOrgaAliasItem("Verkauf 2", "31.12.2001")
           Call aOrgaUnit.AliasNotesNames.AddItem(newAlias) 
           Call aOrgaUnit.save
        End If

Returns:
AliasNotesNameSLSAOrgaAliasseS
History:
04.APR.2000ggredesign
Summmary Top

Public Property Set ParentS AsLSAOrgaCollection

This property sets the parents of units for persons, groups and traits. More than one parent can be set by using this property. Changing parents has also affect on the hierarchy and on other units. For this issue an update request will be created. The changes will take place after running the method "PopulateAllChanges". For changing the parents of a unit all parents have to be set. The property itself checks which units have to be added and which units have to be deleted.

Use Case:
we want to set "Testperson" as Child into the "Sales2" Department
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Dim parent As LSAOrgaUnit
Dim allParents As LSAOrgaCollection
Dim success As Integer
	
        Set aOrgaUnit = OrgaManager.GetUnitByName("TestPerson")
        Set Parent= OrgaManager.GetUnitByName("Sales2")
        If Not aOrgaUnit Is Nothing  And Not parent Is Nothing Then
            Set allParents = aOrgaUnit.Parents 
            Call allParents.addEntry (Parent)
            Set aOrgaUnit.Parents = allParents 
            success = aOrgaUnit.save
            Delete aOrgaUnit
            Delete Parent
            Call allParents.deleteAll
         End If
         If success Then Call OrgaManager.PopulateAllChanges

Parameters:
ParentsLSAOrgaCollectionCollection of units
History:
04.APR.2000ggredesign
Summmary Top

Public Property Get ParentS AsLSAORgaCollection

This property reads all the parents of a unit for persons, groups and traits. All units in which the object is a member will be part of the collection. If there is no parent the collection will be empty.

Use Case:
We read the parents of the "Testperson"
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Dim parent As LSAOrgaUnit
Dim allParents As LSAOrgaCollection
Dim allNames As String
	
        Set aOrgaUnit = OrgaManager.GetUnitByName("Testperson")
        If Not aOrgaUnit Is Nothing Then
           Set allParents = aOrgaUnit.Parents 
           Set Parent = allParents.GetFirst()
           allNames = ""
           While Not Parent Is Nothing
              If allNames = "" Then
                 allNames = Parent.DisplayName
              Else
                 allNames = allNames + "; " + Parent.DisplayName
              End If
              Set Parent = allParents.GetNext()
           Wend	
           Messagebox allNames
        End If

Returns:
ParentsLSAOrgaCollection Collection of units
History:
04.APR.2000ggredesign
Summmary Top

Public Property Set Children AsLSAOrgaCollection

This property sets all children (members) of a unit. If you want to add children to a unit, you must first read the current children (Get Children), then add an entry to the collection and then set the children. The assignement of organization units as children to other units must be populated throughout the LSAOrga database using the method "LSAOrgaManager.PopulateAllChanges" or the agent "LSAOrgEng cUpdate" of the LSAOrga database.

Use Case:
we want to set "Testperson" as Child into the "Projektgruppe" Project group
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Dim Child As LSAOrgaUnit
Dim allChildren As LSAOrgaCollection
Dim success As Integer
	
        Set aOrgaUnit = OrgaManager.GetUnitByName("Projektgruppe")
        Set Child = OrgaManager.GetUnitByName("TestPerson")
        If Not aOrgaUnit Is Nothing  And Not Child Is Nothing Then
            Set allChildren = aOrgaUnit.Children
            Call allChildren.addEntry (Child)
            Set aOrgaUnit.Children = allChildren 
            success = aOrgaUnit.save
            Delete aOrgaUnit
            Delete Child
            Call allChildren.deleteAll
         End If
         If success Then Call OrgaManager.PopulateAllChanges

Parameters:
ChildrenLSAOrgaCollectionall new children (members) of the unit
History:
04.APR.2000ggredesign
Summmary Top

Public Property Get Children AsLSAOrgaCollection

This poperty returns a LSAOrgaCollection with all children (members) of a unit.

Use Case:
We read the children of the "Projektgruppe"
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Dim Child As LSAOrgaUnit
Dim allChildren As LSAOrgaCollection
Dim allNames As String
	
        Set aOrgaUnit = OrgaManager.GetUnitByName("Projektgruppe")
        If Not aOrgaUnit Is Nothing Then
           Set allChildren = aOrgaUnit.Children 
           Set Child = allChildren.GetFirst()
           allNames = ""
           While Not Child Is Nothing
              If allNames = "" Then
                 allNames = Child.DisplayName
              Else
                 allNames = allNames + "; " + Child.DisplayName
              End If
              Set Child = allChildren.GetNext()
           Wend	
           Messagebox allNames
        End If

Returns:
ChildrenLSAOrgaCollection
History:
04.APR.2000ggredesign
Summmary Top

Public Property Get Traits AsLSAOrgaCollection

This property reads all traits of a unit (group or person) and returns them as a LSAOrgaCollection. Traits with and without groups in the domino directory will be returned. They are calculated recursively. Based on the traits returned e.g. buttons can be hidden or validations can be done dynamically.
Traits have to be set using the front end functionality.


Use Case:
We read the traits of the "Testperson"
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Dim Trait As LSAOrgaUnit
Dim allTraits As LSAOrgaCollection
Dim allNames As String
	
        Set aOrgaUnit = OrgaManager.GetUnitByName("Testperson")
        If Not aOrgaUnit Is Nothing Then
           Set allTraits = aOrgaUnit.Traits 
           Set Trait = allTraits.GetFirst()
           allNames = ""
           While Not Trait Is Nothing
              If allNames = "" Then
                 allNames = Trait.DisplayName
              Else
                 allNames = allNames + "; " + Trait.DisplayName
              End If
              Set Trait = allTraits.GetNext()
           Wend	
           Messagebox allNames
        End If

Returns:
TraitsLSAOrgaCollection all traits for the unit
History:
04.APR.2000ggredesign
Summmary Top

Public Property Get ChangeRequests AsLSAOrgaChangeRequest

Summmary Top

Public Property Get DefaultHierarchyPath AsString

Summmary Top

Public Property Get UnitInstanceID AsString

Summmary Top

Public Property Set AddrMgrID AsString

The id with which the LSAAddressManager has been checked in in the InstanceManager.

Summmary Top

Public Property Get AddrMgrID AsString

Summmary Top

Public Property Get AddrMgr AsVariant

Returns a handle to the address manager object

Summmary Top
Method Detail

New

Public Sub New(AttribCorrespondingDocument As NotesDocument,AttribDisplayName As String,AttribNotesName As String,AttribNotesType As String,AttribOrgaType As LSAOrgaType,orgaDB As NotesDatabase,OrgaLog As LSAOrgaLog,SurrogationDate As NotesDateTime,parViewAllUnits As NotesView,paraddrview As NotesView,addrMgrID As String)
This method is always called from the "LSAOrgaManager.NewUnit" method and is not for use by interface programmers

Summmary Top

Delete

Public Sub Delete
Due to some Lotus Script issues, unit objects should be deleted after they were saved for two reasons: to release the memory and to make sure that the next time this object is accessed you really get the currently valid data of this object as it might have been changed by some other functions.

Use Case:
A unit was saved , the memory shall be released
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Dim success as integer
		
        Set aOrgaUnit = OrgaManager.GetUnitByName("Department")
		'.... some changes of the unit
        success = aOrgaUnit.save
        Delete aOrgaUnit

History:
08.JUN.2000RGRDelete the address data and check out
Summmary Top

SetDefaultHierarchyFromParent

Public Function SetDefaultHierarchyFromParent(ParentUnit As Variant,as As Variant,LSAOrgaUnit As Variant) As Variant
This function sets the default hierarchy (specifies default hierarchy for address determination) according to the parent units default hierarchy path; if that is not specified, the first hierarchy path of the parent unit is taken as base for the hierarchy path of the current unit
Use Case:
we want to set in the Default hierarchy of the current unit according to the parent unit "Sales2", while the current unit is "Salesman1" (while Salesman1 is a job in Sales2):
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Dim Parent As LSAOrgaUnit
Dim aDefaultHierarchyPath as String
        Set aOrgaUnit = OrgaManager.GetUnitByName("Salesman1")
		Set Parent = OrgaManager.GetUnitByName("Sales2")
		If Not aOrgaUnit Is Nothing and not Parent is Nothing Then
	  		aDefaultHierarchyPath = aOrgaUnit.SetDefaultHierarchyFromParent(Parent) 
			   success = aOrgaUnit.Save
		End If
		delete aOrgaUnit
		delete Parent


Parameters:
ParentUnitLSAOrgaUnit, must be a valid parent of the current unit
Errors:
1831"InvalidParentUnit" The unit which was passed as parameter is not a valid parent of the current unit
History:
22.JAN.2001rpcreated
Summmary Top

SetChildsSurrogation

Public Sub SetChildsSurrogation(Child As LSAOrgaUnit,Surrogates As LSAOrgaCollection)
This function sets surrogates for members of a group (SurrogationRule). Each member of a group can have specific surrogates for this group (in addition to a general surrogate).

Use Case:
we want to set in the Department "Sales2" a surrogate for the "Testperson"
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Dim Child As LSAOrgaUnit
Dim allChildren As LSAOrgaCollection
Dim allSurrogates as LSAOrgaCollection
Dim SurrogationUnit as LSAOrgaUnits
	
        Set aOrgaUnit = OrgaManager.GetUnitByName("Sales2")
		Set SurrogationUnit = OrgaManager.GetUnitByName("Test")  'this is also a person unit
        If Not aOrgaUnit Is Nothing and not SurrogationUnit is Nothing Then
           Set allChildren = aOrgaUnit.Children
           Set Child = allChildren.GetFirst()
           allNames = ""
           While Not Child Is Nothing
              If Child.DisplayName = "Testperson" Then
                  set allSurrogates = aOrgaUnit.GetChildsSurrogation(Child)
				  call allSurrogates.AddEntry(SurrogationUnit)
				  call aOrgaUnit.SetChildsSurrogation(Child, allSurrogates) 
				  success = aOrgaUnit.Save
				  Goto Done
			  End If
              Set Child = allChildren.GetNext()
           Wend	
        End If
		Done:
		delete aOrgaUnit
		allSurrogates.DeleteAll


Parameters:
ChildLSAOrgaUnitMember of the group
SurrogatesLSAOrgaCollectionCollection of units that should be surrogates for the given member in the group.
History:
04.APR.2000ggredesign
Summmary Top

GetChildsSurrogation

Public Function GetChildsSurrogation(Child As LSAOrgaUnit) As LSAOrgaCollection
Calculates for a given child-unit (parameter "Child") of the current unit a collection of all surrogates.

Use Case:
we want to read all childrens surrogates of the "Sales2" department
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaUnit
Dim Child As LSAOrgaUnit
Dim allChildren As LSAOrgaCollection
Dim allSurrogates as LSAOrgaCollection
Dim SurrogationUnit as LSAOrgaUnits
Dim allNames As String
	
       Set aOrgaUnit = OrgaManager.GetUnitByName("Sales2")
       If Not aOrgaUnit Is Nothing Then
           Set allChildren = aOrgaUnit.Children 
           Set Child = allChildren.GetFirst()
           allNames = ""
           While Not Child Is Nothing
               Set allSurrogates = aOrgaUnit.GetChildsSurrogation(Child)
               Set SurrogationUnit = allSurrogates.GetFirst()
               While Not SurrogationUnit Is Nothing
                  If allNames = "" Then
                     allNames = SurrogationUnit.DisplayName
                  Else
                     allNames = allNames + "; " + SurrogationUnit.DisplayName
                  End If
                  Messagebox child.Displayname + " is surrogated by: " + allNames
                  Set SurrogationUnit = allSurrogates.GetNext()
               Wend
               Set Child = allChildren.GetNext()
            Wend

Parameters:
ChildLSAOrgaUnitthe child-unit
Returns:
LSAOrgaCollectionobject
History:
04.APR.2000ggredesign
Summmary Top

UpdateSerialData

Private Sub UpdateSerialData
Summmary Top

WriteCustomerData

Public Sub WriteCustomerData(field As String,value As Variant)
This function writes data to a customer field of the unit.

Use Case:
we want to write some test data in the department "Sales2"
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim Unit        As     LSAOrgaUnit     
Dim TextList(1) As String
	
      TextList(0) = "Text1"     
      TextList(1) = "Text2"
	
      Set  Unit = OrgaManager.GetUnitByName("Sales2")
      Call Unit.WriteCustomerData("LSACDTime",Now)
      Call Unit.WriteCustomerData("LSACDTextList",TextList)
      Call Unit.Save
      Delete unit

Parameters:
FieldStringthe field name
ValueVariantthe customer data
History:
04.APR.2000ggredesign
12.SEP.2000rpset flag IsSummary
Summmary Top

ReadCustomerData

Public Function ReadCustomerData(field As String) As Variant
This function reads data from a customer field of the unit.
Use Case:
we want to read the customer data in the department "Sales2"
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim Unit        As     LSAOrgaUnit     
Dim CustomerValue1 As Variant
Dim CustomerValue2 As Variant
	
      'read CustomerData
      Set  Unit = OrgaManager.GetUnitByName("Sales2")
      If Not unit Is Nothing Then
         CustomerValue1 = Unit.ReadCustomerData("LSACDTime")
         CustomerValue2 = Unit.ReadCustomerData("LSACDTextList")
      End If

Parameters:
FieldStringthe field name
Returns:
ReadCustomerDataVariant The data format depands on the field type.
History:
04.APR.2000ggredesign
Summmary Top

Save

Public Function Save As Integer
This function saves a unit. If the unit is new, a document in the LSA Orga database is created, if the unit is already part of the database, the document is saved (when properties have changed). If any error occurs, the return value is "FALSE", and an entry is created in the Log database indicating the reason that the units was not saved.
If changes were made that could affect other units, a chagne request document is created in the LSAOrga database. In order to update all affected units (parents, childs), the method "PopulateAllChanges" of the LSAOrgaManager or the agent "LSAOrgEng cUpdate" in the LSAOrga must be run.
Due to some LotusScript issues you should delete this object after a LSAOrgaUnit was saved: to release the memory and to ensure that next time this object is accessed it contains the currently valid values.

Returns:
SaveInteger True / False (successfull / unsuccessfull)
History:
04.APR.2000ggredesign
Summmary Top

Remove

Public Sub Remove
This function removes a unit from the LSA Orga database. The document in the database is not deleted at once, but only marked for deletion. In order to update all affected units (parents, childs), the actual deletion takes place at update time (after running PopulateAllChanges).
Trait groups or units which still hold relationships, or formula traits which still refer to other units must not be removed! In these cases you first have to release all relational references from the unit you want to remove, or specify and evaluate a formula in a formula trait that is empty, so the references from that trait are removed in other units.
Use Case:
we want to remove the unit "Projektgruppe"
Dim OrgaManager As New LSAOrgaManager("", "LSAORGA", "", "LSAORGALOG")
Dim aOrgaUnit As LSAOrgaType
Dim aUnitName As String
	
       aUnitName = "Projektgruppe"
       Set aOrgaUnit = OrgaManager.GetTypeByName(aUnitName)
       Call aOrgaUnit.remove
       Call OrgaManager.PopulateAllChanges

History:
04.APR.2000ggredesign
Summmary Top

CreateUnitDoc

Private Function CreateUnitDoc As NotesDocument
Summmary Top

SaveWithoutUpdate

Private Sub SaveWithoutUpdate(strPropertyName As String,vNewValue As Variant)
Summmary Top

SetNotesTypeAccordingToType

Private Sub SetNotesTypeAccordingToType(strNABGroupType As String)
Summmary Top

setAllPropertiesAccordingToType

Private Sub setAllPropertiesAccordingToType
Summmary Top

validAliasNames

Private Function validAliasNames(AliasNamesToCheck As Variant) As Integer
Summmary Top

ConvertFormula

Private Function ConvertFormula(Instring As String) As String
Summmary Top

FormulaEvaluate

Private Function FormulaEvaluate(formula As String,doc As notesdocument) As Variant
Summmary Top

HasChild

Private Function HasChild(Child As Variant,as As Variant,LSAOrgaUnit As Variant) As Variant
Summmary Top

HasParent

Private Function HasParent(Parent As Variant,as As Variant,LSAOrgaUnit As Variant) As Variant
Summmary Top

getPersonData

Public Function getPersonData As String
Summmary Top

getOrganizationData

Public Function getOrganizationData As String
Summmary Top

getDisplayName

Public Function getDisplayName As String
Summmary Top

getOrganizationS

Public Function getOrganizationS As Variant
Summmary Top

getReference

Public Function getReference As String
Summmary Top

getCustomerContactSearchCriterias

Public Function getCustomerContactSearchCriterias As Variant
Summmary Top

getCustomerOrganizationSearchCriterias

Public Function getCustomerOrganizationSearchCriterias As Variant
Summmary Top

getCustomerSerialData

Public Function getCustomerSerialData As String
Summmary Top

TopLotusScript Doc
© Lotus Professional Services
generated on : 05-Apr-01 8:39:59 AM